import threading
import traceback

import wx

import window
from config import init_config, Config
from plugs import init_log
from serve import proxy_server

if __name__ == '__main__':
    """程序入口"""
    # app = wx.App()
    try:
        init_log()
        init_config()

        window.run()
        # 开启一个线程去监听端口
        threading.Thread(target=proxy_server.run).start()
    except Exception as err:
        traceback.print_exc()
        wx.MessageBox(str(err), "异常", wx.OK | wx.CANCEL | wx.ICON_ERROR)
    app.MainLoop()
